package Bidostar_Data;

import org.apache.log4j.Logger;

/**
 * Created by Dreamslians on 2017/8/9.
 */
public class Baseinfo
{

    public static final Logger logger = Logger.getLogger(Baseinfo.class.getClass());
    public static final String URL1 = "http://beta.ci.bidostar.com/login.html";
    public static final String Username = "test";
    public static final String PW = "abc123";

    public static final String FeedBackInfo = Bidostar_RandomLitter.gen(15) + Bidostar_RandomChineseCharacter.getFixedLengthChinese(20);

    public static final String FeedBack_Info = "SELECT TOP 1 OBD_Feedback.content FROM OBD_Feedback ORDER BY id DESC";

    public static final String Admin_URL = "http://beta.admin.bidostar.com";

    public static final String Master_URL = "http://alpha.master.bidostar.com/login.html";

    public static final String New_Pw = Bidostar_RandomLitter.gen(6);
    public static final String Sure_Pw = New_Pw;

    public static final String feed_info = "test";

    public static final String Ta_title = "警保联动智慧平台";
    public static final String Ci_title = "保险查勘智慧系统";
    public static final String Dc_title = "服务调度中心";


    public static final String URL_ByRelease = "http://ta.bidostar.com/login.html";
    public static final String URL2 = "http://beta.ta.bidostar.com/login.html";


    public static final String URL3 = "http://beta.admin.dc.bidostar.com/login.html";

    public static final String Address = "海淀北二街10号";

    public static final String PhoneReportDriverLience = "123456789012345678";

    //电话报案车牌号（需修改元素值）
    public static final String PhoneReport_BC = "AQ2X73";

    public static boolean checkIsLitter()
    {
        char c = PhoneReport_BC.charAt(0);
        if (((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
        {
            return true;
        } else
        {
            return false;
        }
    }

    public static final String Account = Bidostar_RandomLitter.gen(4);


    public static final String AccountName = Bidostar_RandomLitter.gen(4);


    public static String AccountTelephone()
    {
        String AccountTelephone = "179" + String.valueOf(((int) (Math.random() * 100000000) & 0x03FFFFFF) + 10000000);
        return AccountTelephone;
    }

    public static final String PrivileGroupName = Bidostar_RandomLitter.gen(6);

    public static String Remark()
    {
        String Remark = Bidostar_RandomChineseCharacter.getFixedLengthChinese(5);
        return Remark;
    }

    public static String ReportName()
    {
        String ReportName = Bidostar_RandomChineseCharacter.getFixedLengthChinese(4);
        return ReportName;
    }

    public static final String Admin_Username = "bj-cs";
    public static final String Admin_password = "bdldz135";

    //电话报案车牌号管理
    public static final String CarID = "青AQ2X73";
    /*
        数据库连接数据
     */
    public static final String SqlUrl = "jdbc:sqlserver://beta.db.bidostar.cn:1533;DatabaseName=BidostarBeta";
    public static final String User = "sa";
    public static final String Password = "654321Bdldz";

    public static final String UserName_Master = "test";

    public static final String Ci_User = "peyton";

    public static final String Ci_Password = "SELECT cu_password FROM ChannelUser WHERE cu_code = '" + Ci_User + "'";

    public static final String cu_name = "SELECT cu_name FROM ChannelUser WHERE cu_code = '" + Ci_User + "'";

    public static final String Ta_User = "peyton";

    public static final String Ta_password = "SELECT password FROM Traffic_User WHERE code = '" + Ta_User + "'";

    public static final String ta_name = "SELECT name FROM Traffic_User WHERE code = '" + Ta_User + "'";

    public static final String Dc_User = "bj-cs";

    public static final String Dc_password = "SELECT password FROM User_Admin_Info WHERE name = '" + Dc_User + "'";

    public static final String dc_name = "SELECT nickName FROM User_Admin_Info WHERE name = '" + Dc_User + "'";

    public static final String Master_PW = "select password from User_Admin_Info where name = '" + UserName_Master + "'";

    public static final String Certified = "select Driver_License.certified from Driver_License , Vehicle_Info where Driver_License.uid = Vehicle_Info.userId and Vehicle_Info.licensePlate = '" + CarID + "'";

    //电话报案添加时手机号码
    public static final String phone = "select User_Info.phone FROM Vehicle_Info ,User_Info where User_Info.id = Vehicle_Info.userId and Vehicle_Info.licensePlate = '" + CarID + "'";
    //电话报案添加时姓名
    public static final String name = "select Driver_License.name from Driver_License,Vehicle_Info where Vehicle_Info.userId = Driver_License.uid and Vehicle_Info.licensePlate = '" + CarID + "'";

    //电话报案添加时驾驶证号码
    public static final String license_no = "select Driver_License.license_no from Driver_License,Vehicle_Info where Vehicle_Info.userId = Driver_License.uid and Vehicle_Info.licensePlate ='" + CarID + "'";
    public static final String ACL_id = "select top 1 ACL_id from AccidentCheckLog where ACL_LicensePlate ='" + CarID + "' order by ACL_id desc ";

    public static final String ACL_id2 = "select top 1 * from (select top 2 ACL_id from AccidentCheckLog where ACL_LicensePlate ='" + CarID + "'order by ACL_id desc) as a ORDER BY ACL_id ASC";

    public static final String ACL_Time = "select top 1 ACL_Time from AccidentCheckLog where ACL_LicensePlate  ='" + CarID + "' order by ACL_id desc ";

    public static final String Platform_Ci = "select top 1 Accident_Operate_Log.platform from Accident_Operate_Log,ChannelUser where Accident_Operate_Log.operator_id = ChannelUser.cu_id and ChannelUser.cu_code = '" + Username + "'ORDER BY id desc";

    public static final String Remark = "select top 1 Accident_Operate_Log.remark from Accident_Operate_Log,ChannelUser where Accident_Operate_Log.operator_id = ChannelUser.cu_id and ChannelUser.cu_code = '" + Username + "'ORDER BY id desc";

    public static final String Password_Ci = "select cu_password from ChannelUser where cu_code = '" + Username + "'";

    public static final String name_Ci = "select cu_name from ChannelUser where cu_code = '" + Username + "'";

    //根据车牌号查询设备ID
    public static final String Device_Code = "select device_code from Vehicle_Info where licensePlate ='" + CarID + "'";

    //根据车牌号查询IMEI
    public static final String PhoneReport_Imei = "select Realtime_Location_OBD.imei from Vehicle_Info , Realtime_Location_OBD where  Realtime_Location_OBD.device_code = Vehicle_Info.device_code and Vehicle_Info.licensePlate ='" + CarID + "'";

    public static final String Admin_Password = "select password from User_Admin_Info where name = '" + Admin_Username + "'";

    public static final String Admin_NickName = "select nickName from User_Admin_Info where name = '" + Admin_Username + "'";

    //#################################################################################################

    //Beta交警登录接口验证
    public static final String Traffic_Login = "http://beta.api.traffic.bidostar.cn/1/traffic/user/login.json";

    //Beta保险登录接口验证
    public static final String Insurance_Login = "http://beta.api.insur.bidostar.cn/1/channel/user/login.json";

    //Beta调度登录接口验证
    public static final String Operation_Login = "http://beta.api.admin.bidostar.cn/1/operation/user/login.json";


}
